package sm;




public class EventSelector {
	private SensingService eventObject;
	private TempService tempService = TempService.getInstance();
	private LightService lightService = LightService.getInstance();

	 public EventSelector(){
		 
	 }

    public synchronized SensingService getEventObject(String eventId){
		char[] eventChar1 = eventId.toCharArray();
		char eventChar2 = eventChar1[0];
		 switch (eventChar2) {
	        case '2':  eventObject = tempService; break;
            case '3':  eventObject = lightService; break;
            case '4':  System.out.println("March"); break;
            case '5':  System.out.println("April"); break;
            default: System.out.println("Invalid eventId");break;
			 }
		 return eventObject;
    }
	    

}
